package com.jams.goodox.entity.resp;

import com.jams.goodox.entity.Mapper;
import com.jams.goodox.entity.MeetSessionBean;
import com.jams.goodox.entity.MeetSessionItemBean;
import com.jams.goodox.net.BaseEntity;
import com.jams.goodox.utils.Utils;

import java.util.List;

/**
 * 场次实体
 * Created by jams_zhen on 2017/6/2.
 */

public class MeetSessionResp extends BaseEntity{

    private DataBean data;

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    public static class DataBean implements Mapper<MeetSessionBean> {
        private String dateStr;

        private String placeId;

        public String getDateStr() {
            return dateStr;
        }

        public void setDateStr(String dateStr) {
            this.dateStr = dateStr;
        }

        public String getPlaceId() {
            return placeId;
        }

        public void setPlaceId(String placeId) {
            this.placeId = placeId;
        }

        private List<MeetSessionItemBean> scheduleList;

        public List<MeetSessionItemBean> getScheduleList() {
            return scheduleList;
        }

        public void setScheduleList(List<MeetSessionItemBean> scheduleList) {
            this.scheduleList = scheduleList;
        }

        @Override
        public MeetSessionBean transform() {
            MeetSessionBean meetSessionBean=new MeetSessionBean();
            meetSessionBean.setShowDayStr(String.format("%s %s",Utils.getMonthStr(dateStr),Utils.getWeekByStr(dateStr)));
            meetSessionBean.setCanGoLeft(Utils.timeCurrentCompare(String.format("%s 00:00",dateStr)));//前天是否可点击
            meetSessionBean.setLeftDate(Utils.reDoDate(dateStr,false));
            meetSessionBean.setRightDate(Utils.reDoDate(dateStr,true));
            meetSessionBean.setPlaceId(placeId);
            meetSessionBean.setPlaceDate(dateStr);
            Utils.reDoDate("2016-01-01",false);
            if(scheduleList==null||scheduleList.size()==0)return meetSessionBean;
            meetSessionBean.setMeetSessionTimeList(scheduleList);
            return meetSessionBean;
        }
    }
}
